<p class="Paragraph">You can apply user-defined functions in <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> Calc in the following ways:</p>
<ul class="L1">
<li class="">
<p class="P2">In the <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> Help you will find information for when you want to program the functions as <help:link Id="66872" xmlns:help="http://openoffice.org/2000/help">add-ins</help:link>. This method requires advanced knowledge of programming.</p>
</li>
<li class="">
<p class="P2">Using the Basic-IDE, even without any knowledge of programming, you can define your own functions. You will find the instructions in the following lines:</p>
</li>
</ul>
<p class="Paragraph">In this example we define a VOL(a; b; c) function which calculates the volume of a rectangular parallelepiped with side lengths a, b and c.</p>
<p class="Head2">Defining Your Own Functions in Basic IDE</p>
<p class="P3">Click the <span class="T1">Edit</span> button. You will now see the Basic IDE.</p>
</li>
<li class="">
<p class="P3">Enter the function, as displayed in the illustration.</p>
</li>
<li class="">
<p class="P3">Close the Basic-IDE window with the close area on the title bar.</p>
<p class="P3">Your function is automatically saved in the default module and is from now on always available in your <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname>. If you apply the function in a Calc document, which is to be used on another computer, you can copy the function to the Calc document. You will find the instructions below under the heading "Copying user-defined functions to a document".</p>
</li>
</ol>
<p class="Head2">Applying a user-defined function in <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> Calc.</p>
<p class="Paragraph">Once you have defined the function VOL(a; b; c) in the Basic-IDE, you can apply it in exactly the same way as the built-in functions of <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> Calc.</p>
<ol class="L3">
<li class="">
<p class="P4">Open a <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> Calc document and enter a few numbers, for example, in columns A, B and C.</p>
</li>
<li class="">
<p class="P4">Set the cursor in cell D1 and enter the following:</p>
<p class="P4">=VOL(A1;B1;C1)</p>
<p class="P4">The function is evaluated and you will see the result in cell D1.</p>
</li>
</ol>
<p class="Head2">Copying user-defined functions to a document</p>
<p class="Paragraph">In stage 2 of "Defining a user-defined function in Basic-IDE" in the <span class="T1">Macro</span> dialog you clicked on <span class="T1">Edit </span>. As the default, in the <span class="T1">Macro from</span> field the <span class="T1">soffice - Default - Module1</span> module is selected. The default module resides locally in your user directory.</p>
<p class="Paragraph">If you want to copy the user-defined function to a Calc document, proceed as follows:</p>
<p class="P5">In the <span class="T1">Macro from</span> field select <span class="T1">(Name of the Calc document)- Default - Module1</span>. Click <span class="T1">Edit</span>.</p>
</li>
<li class="">
<p class="P5">Paste the clipboard contents in the Basic-IDE of the document.</p>
<p class="ParaList">Switch to "<help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> Basic Help", then search for "Integrated Development Environment (IDE)".</p>